package com.zzz.service.impl;

import com.aaa.entity.OStock;
import com.aaa.vo.Result;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zzz.service.OStockService;
import com.zzz.mapper.OStockMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 86176
* @description 针对表【o_stock(商品存货信息)】的数据库操作Service实现
* @createDate 2023-03-08 14:36:06
*/
@Service
@SuppressWarnings("all")
public class OStockServiceImpl extends ServiceImpl<OStockMapper, OStock>
    implements OStockService{

    @Autowired
    private OStockMapper oStockMapper;

    //查询商品成交数量
    @Override
    public Result getGoodsSellNum(Integer goodsId) {
        OStock goodsSellNum = oStockMapper.getGoodsSellNum(goodsId);
        return new Result(2000,"查询成功",goodsSellNum);
    }

    //查询当前商品库存余量
    @Override
    public Result getStock(Integer goodsId) {
        OStock oStock = oStockMapper.getGoodsSellNum(goodsId);
        return new Result(2000,"查询成功",oStock);
    }
}




